﻿@model CDV.MC.MatrixDriver.WebApp.Models.MatrixDetailModel
@{
    ViewData["Title"] = "矩阵详细信息";
}
<div id="matrixDetail">
    <table class="table">
        <thead>
            <tr>
                <th>
                    @Html.DisplayNameFor(model => model.MatrixInfo.ID)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.MatrixInfo.Name)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.MatrixInfo.Description)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.MatrixInfo.IPAddress)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.MatrixInfo.Port)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.MatrixInfo.ScaleText)
                </th>
                <th>
                    @Html.DisplayNameFor(model => model.MatrixInfo.IsOnline)
                </th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td id=@("matrix_" + Model.MatrixInfo.ID)>
                    @Html.DisplayFor(model => model.MatrixInfo.ID)
                </td>
                <td>
                    @Html.DisplayFor(model => model.MatrixInfo.Name)
                </td>
                <td>
                    @Html.DisplayFor(model => model.MatrixInfo.Description)
                </td>
                <td>
                    @Html.DisplayFor(model => model.MatrixInfo.IPAddress)
                </td>
                <td>
                    @Html.DisplayFor(model => model.MatrixInfo.Port)
                </td>
                <td>
                    @Html.DisplayFor(model => model.MatrixInfo.ScaleText)
                </td>
                <td>
                    <div id="circleStatus" class=@(Model.MatrixInfo.IsOnline?"matrixCircle-online":"matrixCircle-offline")
                         title=@(Model.MatrixInfo.IsOnline?"在线":"离线") />
                </td>
            </tr>
        </tbody>
    </table>

    <div class="row">
        <div class="col-md-5">
            <div class="row matrixPortTypeTitleContainer">
                <div class="col-md-10">
                    <span class="matrixPortTypeTitle">出 端 口</span>
                </div>
                <div class="col-md-2">
                    <input type="checkbox" id="canMutilSelect" title="勾选之后，可以选中多个出端口进行端口锁定/解锁操作" onchange="mutilSelect_CheckedChanged()">
                    <span title="勾选之后，可以选中多个出端口进行端口锁定/解锁操作">多选</span>
                </div>
            </div>
            <div class="row matrixPortContainer" id="destPorts">
                @Html.DisplayFor(x => x.DestPortInfo)
            </div>
        </div>
        <div class="col-md-2">
            <div class="row" style="height:50px;"></div>
            <div class="row" style="padding:10px 20px;">
                <input id="btnTake" class="btn btn-primary btn-block disabled" type="button" value="切换" onclick="btnTake_Click(@Model.MatrixInfo.ID);" />
            </div>
            <div class="row"></div>
            <div class="row" style="padding:10px 20px;">
                <input id="btnLock" class="btn btn-primary btn-block disabled" type="button" value="锁定端口" onclick="btnLock_Click(@Model.MatrixInfo.ID, this.value == '锁定端口');" />
            </div>
            <div class="row legend-row">
                <span class="legend-container-none">
                    XXX
                </span>
                <span>
                    ->端口无状态
                </span>
            </div>
            <div class="row legend-row">
                <span class="legend-container-lock">
                    XXX
                </span>
                <span>
                    ->端口锁定
                </span>
            </div>
            <div class="row legend-row">
                <span class="legend-container-selecting">
                    XXX
                </span>
                <span>
                    ->端口选中
                </span>
            </div>
            <div class="row legend-row">
                <span class="legend-container-linkToSrc">
                    XXX
                </span>
                <span>
                    ->连接中源端口
                </span>
            </div>
            <div class="row legend-row">
                <span class="legend-container-linkToSrc-selecting">
                    XXX
                </span>
                <span>
                    ->连接中源端口(选中)
                </span>
            </div>
            <div class="row legend-row">
                <span class="legend-container-error">
                    XXX
                </span>
                <span>
                    ->端口操作失败
                </span>
            </div>
        </div>
        <div class="col-md-5">
            <div class="row matrixPortTypeTitleContainer">
                <div class="col-md-10">
                    <span class="matrixPortTypeTitle">源 端 口</span>
                </div>
                @*<div class="col-md-2">
                        <input class="btn btn-info btn-xs" type="button" value="Clear" title="点击取消所有选中的源端口" onclick="unselectAllSrcPort();">
                    </div>*@
            </div>
            <div class="row matrixPortContainer" id="srcPorts">
                @Html.DisplayFor(x => x.SrcPortInfo)
            </div>
        </div>
    </div>
</div>
